.SUFFIXES: .class .java
FILES = svm/libsvm/svm.class svm/libsvm/svm_model.class svm/libsvm/svm_node.class \
		svm/libsvm/svm_parameter.class svm/libsvm/svm_problem.class \
		svm/libsvm/svm_print_interface.class \
		svm/svm_train.class svm/svm_predict.class svm/svm_scale.class \
	        svm/run_svm.class svm/matrixToFile.class main/main.class

#JAVAC = jikes
JAVAC_FLAGS =
JAVAC = javac

all: $(FILES)
	javac -cp ../lib/ejml-0.20.jar nmf/*.java

.java.class:
	$(JAVAC) $(JAVAC_FLAGS) $<
	
run_nmf: nmf/*.class
	java -cp .:../lib/ejml-0.20.jar nmf.NMFAlgorithmBenchmarking

run_svm: svm/*.class svm/libsvm/*.class main/*.class
	java main.main

libsvm/svm.java: libsvm/svm.m4
	m4 libsvm/svm.m4 > libsvm/svm.java

clean:
	rm -f svm/libsvm/*.class svm/*.class svm/*.jar main/main.class nmf/*.class

dist: clean all
	rm svm/*.class svm/libsvm/*.class main/main.class nmf/*.class
